﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AnaxibiaStudios.BeanPermutator;

namespace TestBeanPermutator
{
  public static class Permutator
  {
    public static PermuteBase<T> Create<P, T>(IList<T> list, Func<T, T, bool> canSwap) where P : PermuteBase<T>
    {
      var ctor = typeof(P).GetConstructor(new Type[] { typeof(IList<T>), typeof(Func<T, T, bool>) });

      var permer = ctor.Invoke(new object[] { list, canSwap });

      return permer as PermuteBase<T>;
    }
  }

}
